import Vue from 'vue'
import request from '@/itsoftUI/utils/request'
import qs from "qs"
const baseUrl =  Vue.prototype.$itsoftUI.config.serviceUrl  + "/repair"

//工作台api
export const repairInfoApi = {
    List: function (pageNum, pageSize, search) {
        const data = {
            pageNum,
            pageSize,
            search
        }
        return request({
            url: baseUrl + '/repairInfo/list',
            method: 'post',
            data: qs.stringify(data)
        })
    },
    //提取信息
    Get: function (id) {
        const data = {
            id
        };
        return request({
            url: baseUrl + "/repairInfo/get",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //驳回原因
    GetRejectReason: function (name) {
        const data = {
            name
        };
        return request({
            url: baseUrl + "/repairInfo/getRejectReason",
            method: "post",
            data: qs.stringify(data)
        });
    },
    //审核
    Check: function (id, status, areaId, deptId, ifUrgent, projectId, reason, remark,source) {
        const data = {
            id,
            status,
            areaId,
            deptId,
            ifUrgent,
            projectId,
            reason,
            remark,
            source
        };
        return request({
            url: baseUrl + "/repairInfo/check",
            method: "post",
            data: qs.stringify(data)
        });
    },
    // 删除
    Del: function (ids) {
        const data = {
            ids
        }
        return request({
            url: baseUrl + "/systemDictData/delete",
            method: "post",
            data: qs.stringify(data)
        });
    },
    save: function (data) {
        const config = {
            headers: {
                'Content-Type': 'application/json;charset=utf-8'
            },
        }
        return request.post(baseUrl + "/systemDictData/save", data, config)
    }
}